home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / insight.idb / usr / share / Insight / xhelp / samples / sampleDoc / sample.sgm.z / sample.sgm
Encoding:
Text File  |  1997-07-30  |  12.5 KB  |  393 lines

  1.  
  2. <dochelp>
  3.  
  4. <!-- 
  5.   ==================================================================
  6.   This block denotes a SGML-style comment.
  7.  
  8.   For those that are unfamiliar with SGML, this sample file
  9.   will try to cover the usage of a variety of the tags that
  10.   are used in the XHELP DTD. The examples shown in this sample
  11.   should be sufficient for a writer to produce a very high-quality,
  12.   functional help document for use with an application.
  13.  
  14.   It is best to view this sample once it has been published,
  15.   and then compare what you see in the viewing software to
  16.   the actual tags displayed in this file. 
  17.  
  18.   Each HelpTopic block written below displays how to use the
  19.   DTD to implement specific elements/constructs. It should be
  20.   fairly self-explanatory.
  21.  
  22.   A couple of things to look for when constructing/editing
  23.   your SGML file:
  24.  
  25.     o Make sure a starting element tag has an associated
  26.           end tag! If not, then the file will not compile
  27.           properly. This is analagous to missing a bracket
  28.           or paranthesis in a C program!
  29.  
  30.     o SGML is NOT case sensitive! "HELPTOPIC" is the same
  31.        as "helptopic", which is the same as "HelpTopic", etc.
  32.   ==================================================================
  33. -->
  34.  
  35. <HelpTopic HelpID="intro">
  36. <Helplabel>SGI Sample SGML File</Helplabel>
  37. <Description>
  38. <para>This file contains examples using many of the constructs used 
  39. in the XHELP DTD.</para>
  40. <para>Notice that the general outline used for putting together 
  41. a help "card" is defined by this particular SGML block. The preceding tag
  42. defines the title that will be displayed for this card. The area you
  43. are currently reading is a description for the feature or function you
  44. are documenting. It is not necessary to use each of these tags, although
  45. the "HelpTopic" tag is required.</para>
  46.  
  47. <para>A writer of help information may also wish to include a glossary
  48. of terms. In that way, the documenter can tag terms within the text,
  49. and have them display a specified definition from within the viewer. 
  50. A sample of this is: <glossterm>sgihelp</glossterm>.</para>
  51. <para>The actual definition for the term is found at the end of this
  52. SGML sample.</para>
  53. </Description>
  54. </HelpTopic>
  55.  
  56.  
  57.  
  58. <!--
  59.   ==================================================================
  60.   It's important to point out that the "HelpID" is the glue that
  61.   binds the help text to the application, through the use of the
  62.   provided Help API (library, header file).
  63.   ==================================================================
  64. -->
  65.  
  66. <HelpTopic HelpID="helpid_info">
  67. <Helplabel>What is a HelpID?</Helplabel>
  68. <Description>
  69. <para>The HelpID attribute is used to by your application to
  70. instruct the help server which help "card" to display. In this
  71. case, sending the help server an ID of "helpid_info" would bring up
  72. this particular block (or "card").</para>
  73. <para>The other "ID" is often used as an anchor point 
  74. (and should be used within an "ANCHOR" tag) for hypertext
  75. links within your text. If you wish to refer to a particular card
  76. one simply uses the ID as the anchor point for the link syntax.</para>
  77. </Description>
  78. </HelpTopic>
  79.  
  80.  
  81.  
  82. <!--
  83.   ==================================================================
  84.   This section illustrates the simple usage of specifying a note,
  85.   warning, tip, or caution within your help document.
  86.   ==================================================================
  87. -->
  88.  
  89. <HelpTopic HelpID="note_example">
  90. <Helplabel><Anchor Id="AI003">Using Notes, Warnings or Tips Within a Paragraph</Helplabel>
  91. <Description>
  92. <para>Within the paragraph tag, there are a variety of text marking
  93. mechanisms. Each of these delineations must appear as part of the
  94. paragraph ("para") element.</para>
  95. <para>This area shows the documentor how a warning, note or "tip"
  96. can be used within a persons's help text.</para>
  97.  
  98. <para>
  99. <warning><para>Be Careful. This is a warning.</para></warning>
  100. <note><para>For your information, this is a note.</para></note>
  101. <tip><para>When you prepare your help file, you may wish to include a tip.</para>
  102. </tip>
  103. <caution><para>Use a caution tag when you wish to have the user use caution!</para>
  104. </caution>
  105. </para>
  106. </Description>
  107. </HelpTopic>
  108.  
  109.  
  110.  
  111. <!--
  112.   ==================================================================
  113.   This next section illustrates how to display computer output, 
  114.   program listings, etc. within your help document.
  115.   ==================================================================
  116. -->
  117.  
  118. <HelpTopic HelpID="literal_example">
  119. <Helplabel>Using Literals or Examples Within a Paragraph</Helplabel>
  120. <Description>
  121. <para>
  122. This area shows the documentor how to implement specific examples within
  123. their help text. It also describes how to the "literal" tag.</para>
  124. <para>
  125. When used within a paragraph, the LiteralLayout tag
  126. tells the viewing software to take this next block "as is",
  127. with all accompanying new-lines and spacing left intact.</para>
  128. <Example>
  129. <Title>Various Examples: ComputerOutput, LiteralLayout, ProgramListing</Title>
  130.  
  131. <para>
  132. What follows is a computer output listing from when a
  133. user typed <userInput>ls</userInput> :
  134. <ComputerOutput>
  135. % ls -l
  136. total 6777
  137. -rwxr-xr-x  1 guest  guest   29452 Mar  8 19:12 menu*
  138. -rw-r--r--  1 guest  guest    2375 Mar  8 19:11 menu.c++
  139. </ComputerOutput>
  140. </para>
  141.  
  142. <para>
  143. Each of the subsequent three entries should be indented and on their
  144. own line:
  145. <LiteralLayout>
  146.     Here is line one.
  147.     This is line two.
  148.     This is line three.
  149. </LiteralLayout>
  150. </para>
  151.  
  152. <para>
  153. The following is a listing from a "C" program:
  154. <ProgramListing>
  155.     #include "X11/Xlib.h"
  156.     #include "helpapi/HelpBroker.h"
  157.  
  158.     void main(int, char**)
  159.     {
  160.          /* default to the value of the DISPLAY env var */
  161.          Display *display = XOpenDisplay(NULL);
  162.  
  163.          if( display ) {
  164.                /* initialize the help server */
  165.                SGIHelpInit(display, "MyApp", ".");
  166.          }
  167.          ...
  168.     }
  169. </ProgramListing>
  170. </para>
  171. </Example>
  172.  
  173. </Description>
  174. </HelpTopic>
  175.  
  176.  
  177.  
  178. <!--
  179.   ==================================================================
  180.   This next section illustrates how to incorporate graphics within
  181.   your help text.
  182.   ==================================================================
  183. -->
  184.  
  185. <HelpTopic HelpID="graphic_example">
  186. <Helplabel>Using Graphics or Figures Within Your Help Text</Helplabel>
  187. <Description>
  188. <para>
  189. This area displays how a graphics or figure can be used within the flow of
  190. your information. The following figure is in the "GIF" format:
  191. </para>
  192.  
  193. <Figure ID="figure_01" Float="Yes">
  194.     <title>A GIF Raster Image</title>
  195.     <Graphic fileref="sample1.gif" format="GIF"></Graphic>
  196. </Figure>
  197.  
  198. <para>
  199. Currently, support is provided for <emphasis>raster</emphasis> graphics in
  200. the GIF and TIF formats. Support is provided for <emphasis>vector</emphasis>
  201. graphics utilizing the CGM format.
  202. </para>
  203. <para>
  204. This next figure in the CGM (Computer Graphics Metafile) format:
  205. </para>
  206.  
  207. <Figure ID="figure_02">
  208.     <title>A CGM Vector Image</title>
  209.     <Graphic fileref="sample2.cgm" format="CGM"></Graphic>
  210. </Figure>
  211.  
  212. <para>
  213. A special note that all equations are treated as inline images, as shown
  214. here:
  215. <equation>
  216.     <Graphic fileref="matrix.gif" format="GIF"></Graphic>
  217. </equation>
  218. </para>
  219.  
  220. </Description>
  221. </HelpTopic>
  222.  
  223.  
  224.  
  225. <!--
  226.   ==================================================================
  227.   Hyperlinks can be a very powerful navigation mechanism!
  228.   Liberal usage is encouraged.
  229.   ==================================================================
  230. -->
  231.  
  232. <HelpTopic HelpID="link_example">
  233. <Helplabel>Using HyperLinks</Helplabel>
  234. <Description>
  235. <para>One of the most powerful capabilities of the sgihelp viewer
  236. is the use of hyperlinks to associate like pieces of information. 
  237. Constructing these links in SGML is trivial.</para>
  238. <para>Notice that the "Link" element requires an attribute called
  239. "Linkend". This defines the area (anchor) to link to. The "Linkend"
  240. attribute points to the ID of some SGML element. In composing
  241. help text, it is probably best to assign an ID to each "HelpTopic"
  242. element, and use those same ID's when specifying a Link.</para>
  243. <para>A link is defined below:</para>
  244. <para>For more information about using Notes, refer to the area
  245. entitled <Link Linkend="AI003">"Using Notes, Warnings or Tips
  246. Within a Paragraph"</Link></para>
  247. <para>Note that the "Anchor" tag can also be used within a
  248. document to point to any level of granularity the author
  249. wishes to link to.</para>
  250. </Description>
  251. </HelpTopic>
  252.  
  253.  
  254.  
  255. <!--
  256.   ==================================================================
  257.   Note that there are *many* ways to specify lists. This example
  258.   shows some commonly-used permutations.
  259.   ==================================================================
  260. -->
  261.  
  262. <HelpTopic HelpID="list_example">
  263. <Helplabel>Using Lists Within Your Help Text</Helplabel>
  264. <Description>
  265. <para>This area displays how a person can author 
  266. various types of lists within their help text.</para>
  267.  
  268. <para>Here is an itemized list that uses a dash to preface each item:</para>
  269. <ItemizedList Mark="dash">
  270. <ListItem><para>First Entry</para></ListItem>
  271. <ListItem><para>Second Entry</para></ListItem>
  272. <ListItem><para>Third Entry</para></ListItem>
  273. </ItemizedList>
  274.  
  275. <para>Here is an itemized list that uses a bullet to preface each item:</para>
  276. <ItemizedList Mark="bullet">
  277. <ListItem><para>First Entry</para></ListItem>
  278. <ListItem><para>Second Entry</para></ListItem>
  279. </ItemizedList>
  280.  
  281. <para>Here is an ordered list, using standard enumeration:</para>
  282. <OrderedList>
  283. <ListItem><para>First Entry</para></ListItem>
  284. <ListItem><para>Second Entry</para></ListItem>
  285. <ListItem><para>Third Entry</para></ListItem>
  286. </OrderedList>
  287.  
  288. <para>Here is another ordered list, using upper-case Roman enumeration,
  289. showing nesting (sub-items) within the list (outline format):</para>
  290. <OrderedList Numeration="Upperroman">
  291. <ListItem><para>First Entry</para></ListItem>
  292. <ListItem><para>Second Entry
  293.     <OrderedList Numeration="Upperalpha" InheritNum="Inherit">
  294.         <ListItem><para>First SubItem</para></ListItem>
  295.         <ListItem><para>Second SubItem</para></ListItem>
  296.         <ListItem><para>Third SubItem</para></ListItem>
  297.         <ListItem><para>Fourth SubItem</para></ListItem>
  298.     </OrderedList>
  299. </para></ListItem>
  300. <ListItem><para>Third Entry</para></ListItem>
  301. </OrderedList>
  302.  
  303. <para>Here is a variable list of terms:</para>
  304. <VariableList>
  305. <VarListEntry>
  306. <term>SGI</term>
  307. <ListItem><para>Silicon Graphics, Inc.</para></ListItem>
  308. </VarListEntry>
  309. <VarListEntry>
  310. <term>SGML</term>
  311. <ListItem><para>A Meta-language for defining documents.</para></ListItem>
  312. </VarListEntry>
  313. </VariableList>
  314.  
  315. </Description>
  316. </HelpTopic>
  317.  
  318.  
  319.  
  320. <!--
  321.   ==================================================================
  322.   Some final examples...
  323.   ==================================================================
  324. -->
  325.  
  326. <HelpTopic HelpID="misc_example">
  327. <Helplabel>Other Miscellaneous Textual Attributes</Helplabel>
  328. <Description>
  329. <para>This area displays some miscellaneous tags that can be used
  330. within the context of your help document.</para>
  331.  
  332. <para>
  333. <Comment>This is a comment that is not to be confused
  334. with the SGML-style comment! Instead, this comment will be
  335. parsed and carried into the text of your document. Usually it's
  336. used in production, for specifying to someone an area of concern,
  337. an area that needs editing, etc.
  338. </Comment> 
  339. </para>
  340.  
  341. <para>Within your text, you may wish to denote a footnote.
  342. <Footnote id="foot1"><para>This block is a footnote!</para></Footnote>
  343. The XHELP DTD will allow you to do that.
  344. </para>
  345.  
  346. <para>
  347. You may wish to add a copyright symbol to your text, such as:
  348. Silicon Graphics, Inc.<trademark Class="Copyright"></trademark>
  349. </para>
  350. </Description>
  351. </HelpTopic>
  352.  
  353.  
  354.  
  355. <!--
  356.   ==================================================================
  357.   If you wish to use/have a glossary of terms within your help text,
  358.   it is advised to put it at the end of your help "book", as shown 
  359.   here. NOTE: CR or other characters (#PCDATA) is NOT allowed 
  360.   between the <Glossary> and <Title> tags! (mixed content model)
  361.   ==================================================================
  362. -->
  363.  
  364. <Glossary>
  365. <Title>Glossary</Title>
  366. <GlossEntry>
  367. <GlossTerm>help</GlossTerm>
  368. <GlossDef>
  369. <para>To give assistance to; to get (oneself) out of a difficulty;
  370. a source of aid.</para>
  371. </GlossDef>
  372. </GlossEntry>
  373. <GlossEntry>
  374. <GlossTerm>sgihelp</GlossTerm>
  375. <GlossDef>
  376. <para>This is Silicon Graphics, Inc. version of a "Xhelp" compatible
  377. server. Through the use of an available API, and a help text
  378. compiler, books can be constructed that can be used to render
  379. help information for the given application.</para>
  380. </GlossDef>
  381. </GlossEntry></Glossary>
  382.  
  383.  
  384. <!--
  385.   ==================================================================
  386.   Don't forget the very last ending tag...!!!
  387.   ==================================================================
  388. -->
  389.  
  390. </dochelp>
  391.  
  392.